package com.example.demo

import android.util.Log

object TimeCostRecorder {
    const val TAG = "TimeCostRecorder"
    var startTime = 0L
    @JvmStatic
    fun startTime(methodName: String) {
        startTime = System.currentTimeMillis()
        Log.d(TAG, "startTime(), ${methodName}, startTime=${startTime}")
    }
    @JvmStatic
    fun endTime(methodName: String) {
        Log.d(TAG, "endTime(), $methodName")
        val endTime = System.currentTimeMillis()
        val intervalTimeMS = endTime - startTime
        Log.d(TAG, "${methodName}, intervalTimeMS=${intervalTimeMS}")
    }
}